package handlers

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"net/http"
)

func GetRecordsHandler(c *gin.Context) {
	name := c.DefaultQuery("name", "")
	fmt.Println("name:>>> ", name)
	service := serviceStruct{
		Name: name,
	}
	ret, err := service.handleRecordsService()
	if err != nil {
		c.JSONP(http.StatusBadRequest, nil)
		return
	}
	c.JSON(http.StatusOK, ret)
}
